class Solution:
    def countAsterisks(self, s: str) -> int:
        count_yy = 0
        all_num = 0
        for i in s:
            if i =='|':
                count_yy +=1
                if count_yy == 2:
                    count_yy = 0
            if count_yy == 0:
                if i =='*':
                    all_num += 1
        return all_num

    def countAsterisks(self, s: str) -> int:
        s = s.split('|')
        all_num = 0
        for i in range(len(s)):
            if i %2 ==0:
                all_num += s[i].count('*')
        return all_num

if __name__ == '__main__':
    s = "l|*e*et|c**o|*de|"
    solution = Solution()
    val = solution.countAsterisks(s)
    print(val)